#!/bin/sh
isExe=${deploy}
sysName=${JOB_NAME}
serverIP=${hostNames}

if $isExe; then
	servers=`awk 'BEGIN{list="'${serverIP}'";split(list,ip_list,",");for(ip in ip_list){print ip_list[ip];}}'`
	for server in ${servers[*]}
	do
		salt -L "$server" cmd.run "d:\\scripts\\deploy.bat $sysName > d:\\logs\\deploy.log"
		salt -L "$server" cmd.run "d:\\scripts\\IISRecycler.exe ${sysName}.ewt360.com >> d:\\logs\\deploy.log"
	done
else
	echo  'skip deploy'
fi

